﻿using Dln.Common;
using Dln.Common.Helper;
using Dln.Model;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Default1 : System.Web.UI.Page
{
    public string sql = "";
    protected void Page_Load(object sender, EventArgs e)
    {
        string Key = "Laf5JVhF/H36iMGyB9dXpZq2j95klaqOaFlPqz4VwHuaA6oxp6JYEw==";
        string UnicodeKey = Key.Replace("+", "%2B");

        IList<WebServiceData> webServiceDataist = new List<WebServiceData>();
        WebServiceData model = null;
        object[] arge = new object[1];
        arge[0] = Key;
        var url = CommonHelper.GetAppSettings("DlnService1");
        //昨日业务收入
        object getYesterdayAmount = WebServiceHelper.InvokeWebService(url, "GetYesterdayAmount", arge);
        if (getYesterdayAmount != null)
        {
            model = new WebServiceData();
            model.ServiceName = "GetYesterdayAmount";
            model.ServiceData = getYesterdayAmount.ToString();
            model.SearchDate = DateTime.Now.Date;
            webServiceDataist.Add(model);
        }

        //昨日门诊人次
        object getYesterdayOutNum = WebServiceHelper.InvokeWebService(url, "GetYesterdayOutNum", arge);
        if (getYesterdayOutNum != null)
        {
            model = new WebServiceData();
            model.ServiceName = "GetYesterdayOutNum";
            model.ServiceData = getYesterdayOutNum.ToString();
            model.SearchDate = DateTime.Now.Date;
            webServiceDataist.Add(model);
        }

        if (webServiceDataist.Count > 0)
        {
            foreach (var item in webServiceDataist)
            {
                var result = SqlHelper.Context.Insert<WebServiceData>(item);
                if (result > 0)
                {
                }
            }
        }
    }
}